/*
 * socket.h - defines a portable tcp and udp socket class
 *
 * Copyright(c) Bert van der Weerd <bsod@well.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING. If not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA.
 * 
 */


/* for sockets */

#ifdef _MSC_VER

/* please note that you must include this file before includeing <windows.h> */
#include <winsock.h>
typedef int socklen_t;

#else
# include <stdio.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
# include <unistd.h>

  /* we use SOCKET and closesocket() instead under unix to maintain compatible with visual c++ */
# define SOCKET int
# define closesocket(s) close(s)

  /* SunOS doesnt define INADDR_NONE */
# ifndef INADDR_NONE
#  define INADDR_NONE -1
# endif
#endif


/* arrrgg i dont waant it */
int wsa_startup(); // required by winsock as first function called (NZE) (nop on Linux)
